
import type { App } from 'vue'
import SvgIcon from '@/components/SvgIcon/index.vue'

// 引入element plus icons
import * as ElementPlusIconsVue from '@element-plus/icons-vue'

const allComponent: Record<string, any> = { SvgIcon }
// 利用自定义插件注册全局组件
export default {
    install(app: App) {
        Object.keys(allComponent).forEach(key => {
            app.component(key, allComponent[key])
        })
        // 将element plus  icon注册为全局组件
        for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
            app.component(key, component)
        }
    }
}